/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evangelion.core.bean;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;


/**
 * @author Kellycasma
 */
@Entity
@Table(name = "facturas_alumnos")
@XmlRootElement
@NamedQueries({@NamedQuery(name = "FacturaAlumno.findAll", query = "SELECT f FROM FacturaAlumno f"),
        @NamedQuery(name = "FacturaAlumno.findById", query = "SELECT f FROM FacturaAlumno f WHERE f.id = :id"),
        @NamedQuery(name = "FacturaAlumno.findByFechafactura", query = "SELECT f FROM FacturaAlumno f WHERE f.fechafactura = :fechafactura"),
        @NamedQuery(name = "FacturaAlumno.findByFecharegistro", query = "SELECT f FROM FacturaAlumno f WHERE f.fecharegistro = :fecharegistro"),
        @NamedQuery(name = "FacturaAlumno.findByImporte", query = "SELECT f FROM FacturaAlumno f WHERE f.importe = :importe"),
        @NamedQuery(name = "FacturaAlumno.findByServicio", query = "SELECT f FROM FacturaAlumno f WHERE f.servicio = :servicio")})
public class FacturaAlumno implements Serializable {


    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;

    @Column(name = "fechafactura")
    @Temporal(TemporalType.DATE)
    private Date fechafactura;



    @Column(name = "fecharegistro")
    @Temporal(TemporalType.DATE)
    private Date fecharegistro;

    @Column(name = "importe")
    private Double importe;

    @Column(name = "iva")
    private Double iva;

    @Size(max = 50)
    @Column(name = "servicio")
    private String servicio;

    @JoinColumn(name = "id_alumno", referencedColumnName = "id")
    @ManyToOne
    private Alumno alumno;

    @JoinColumn(name = "id_cliente", referencedColumnName = "id")
    @ManyToOne
    private Cliente cliente;

    @JoinColumn(name = "id_seccion", referencedColumnName = "id")
    @ManyToOne
    private Seccione seccion;


    public FacturaAlumno() {
    }


    public FacturaAlumno(Integer id) {
        this.id = id;
    }


    public Integer getId() {
        return id;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public Date getFechafactura() {
        return fechafactura;
    }


    public void setFechafactura(Date fechafactura) {
        this.fechafactura = fechafactura;
    }


    public Date getFecharegistro() {
        return fecharegistro;
    }


    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }


    public Double getImporte() {
        return importe;
    }


    public void setImporte(Double importe) {
        this.importe = importe;
    }


    public Double getIva() {
        return iva;
    }


    public void setIva(Double iva) {
        this.iva = iva;
    }


    public String getServicio() {
        return servicio;
    }


    public void setServicio(String servicio) {
        this.servicio = servicio;
    }


    public Alumno getAlumno() {
        return alumno;
    }


    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }


    public Cliente getCliente() {
        return cliente;
    }


    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }


    public Seccione getSeccion() {
        return seccion;
    }


    public void setSeccion(Seccione seccion) {
        this.seccion = seccion;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }


    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FacturaAlumno)) {
            return false;
        }
        FacturaAlumno other = (FacturaAlumno) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }


    @Override
    public String toString() {
        return "com.evangelion.core.bean.FacturaAlumno[ id=" + id + " ]";
    }

}
